import RPi.GPIO as GPIO
from time import sleep

pin = 32        # GPIO 12

GPIO.setmode(GPIO.BOARD)
GPIO.setup(pin, GPIO.OUT)
pwm = GPIO.PWM(pin, 50)

pwm.start(0)

def set_angle(angle):
    duty = angle / 18 + 2
    GPIO.output(pin, True)
    pwm.ChangeDutyCycle(duty)
    sleep(1)
    GPIO.output(pin, False)
    pwm.ChangeDutyCycle(0)

set_angle(90)
sleep(1)
set_angle(60)
